Repository navigation
fix(id): roll back cancelled identity registrations - #9105
Conversation
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 47 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
Codex Review Summary: ❌ FailedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Verification update: the cancellation-aware registration/rollback implementation and deterministic persistent-store regression are in this PR. The focused |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3dd94b0cb1
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| let _ = ack_tx.send(()); | ||
| Ok(result) |
There was a problem hiding this comment.
Release the detached database handle before returning success
When a caller drops the store immediately after successful registration and reopens the same path, sending the acknowledgement only wakes the detached task; it does not wait for that task to release its captured Arc<IdentityDb>. The blocking pool can therefore attempt the reopen before the detached task resumes, causing redb to return DatabaseAlreadyOpen. This affects the existing test_restart_at_bound_serves_existing_refuses_new and can make test_wrong_key_refuses_to_open_store receive a locking error instead of the expected authentication error. Previously, awaiting the persistence task ensured its database reference was released before returning. Synchronize resource release on successful registration while preserving cancellation rollback.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in c5f3487 (task 17181, lane code-b). register() now keeps the JoinHandle of the detached registration task and, after sending the acknowledgement, joins it before returning, so the clients write lock and the captured Arc are released before a successful return; a caller that drops the store and reopens the same path no longer races the detached task for the redb lock. Cancellation rollback is unchanged: dropping the caller before the acknowledgement still errors ack_rx and rolls back. Verification on the laptop: cargo test for id-web identity::tests, 43 passed and 0 failed, including test_cancelled_registration_rolls_back_persistent_state, test_restart_at_bound_serves_existing_refuses_new, and test_wrong_key_refuses_to_open_store; rustfmt --check clean. The branch was also rebased onto current main (the change now lands in pkgs/id/crates/id-web/src/identity.rs after the crate split).
|
agent-note:v1 |
3dd94b0 to
c5f3487
Compare
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
agent-note:v1 |
Fixes #9089.
Problem
The detached registration task could persist and account for a new identity after its request future was cancelled, before the caller created the name watcher and received the signed token. This left an unreachable identity consuming admission capacity, including after restart.
Solution
Verification
rustfmt --edition 2024 --check pkgs/id/src/web/identity.rs— passed.git diff --check— passed.cargo test --manifest-path pkgs/id/Cargo.toml --features web --lib test_cancelled_registration_rolls_back_persistent_state— blocked before test execution by the existingpkgs/idweb crate-split compile errors tracked by pkgs/id: web lib does not compile on main — crate-split visibility left 5 unresolved/private sites in src/web #8795 / Drew-owned PR fix(id): restore web build after crate split #8818. No unrelated files were changed.Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.